package com.mmall.service;

import com.mmall.common.ServerResponse;
import com.mmall.pojo.User;

/**
 * @author 孙许
 * @date 2018-08-25
 * @description
 */
public interface IUserService {
    /**
     * 登陆
     * @param username
     * @param password
     * @return
     */
    ServerResponse<User> login(String username, String password);

    /**
     * 注册
     * @param user
     * @return
     */
    ServerResponse<String> register(User user);

    ServerResponse<String> checkValid(String str, String type);

    /**
     * 查询忘记密码问题
     * @param username
     * @return
     */
    ServerResponse selectQuestion(String username);

    /**
     * 检查问题答案是否正确
     * @param username
     * @param question
     * @param answer
     * @return
     */
    ServerResponse<String> checkAnswer(String username, String question, String answer);

    /**
     * 重置密码
     * @param username
     * @param passwordNew
     * @param forgetToken
     * @return
     */
    ServerResponse<String> forgetResetPassword(String username, String passwordNew, String forgetToken);

    /**
     * 登陆状态重置密码
     * @param passwordOld
     * @param passwordNew
     * @param user
     * @return
     */
    ServerResponse<String> resetPassword(String passwordOld, String passwordNew, User user);

    /**
     * 更新用户信息
     * @param user
     * @return
     */
    ServerResponse<User> updateInformation(User user);

    /**
     * 根据id获取用户详情
     * @param userId
     * @return
     */
    ServerResponse<User> getInformation(Integer userId);

    ServerResponse checkAdminRole(User user);
}
